Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Fix for Visual Studio 2019 Preview #2014

Merged
merged 7 commits into from
Oct 26, 2018
Merged

Conversation

jcansdale
Copy link
Collaborator

@jcansdale jcansdale commented Oct 26, 2018

This PR does the required changes to make the extension play nicely with Visual Studio 2019 Preview.

  • Add Visual Studio 2019 compatible GitHub.TeamFoundation.16 project (Team Explorer extension)
  • Allow IGitActionsExt.CloneAsync to be called from Visual Studio 2019 (required a little reflection)
  • Use ITeamExplorerServices.OpenRepository rather than IVSServices.TryOpenRepository
  • Add Microsoft.TeamFoundation.* v16 assemblies to lib folder
  • Pass IServiceProvider rather than IAsyncServiceProvider to VSGitExt (avoiding type name collisions)
  • Commented out GraphsNavigationItemTests, which were previously ignored but now not compiling

How to test

This PR has touched the code responsible for cloning a repository and for opening an already cloned repository. We should check this functionality on Visual Studio 2015, 2017 and 2019.

Check Cloning a Repository

  1. Click File > Open > Open from GitHub...
  2. Select (or paste) a repository and Clone
  3. Check Team Explorer - Home appear with clone process
  4. Check name of repository appears on banner when clone completed
  5. Check Solution Explorer pane has target repository folder open

Check Opening a Repository

  1. Click Team > Manager Connections...
  2. Make sure you're logged into GitHub or GHE
  3. Double click on a repository under GitHub / GHE
  4. Check Team Explorer - Home opens with target repository
  5. Check Solution Explorer pane
  • Expect this to be empty on Visual Studio 2015
  • Expect this to contain target repository folder on Visual Studio 2017 and 2019

Possible issues

I believe the issue from #1859 is back in Visual Studio 2019 Preview, but I've heard this should be fixed in the public release. This shouldn't happen every time you install, but it's something to watch out for!

These are required for Visual Studio 2019 support.
There are assemblies with exactly the same IAsyncServiceProvider
namespace + name. Change to use IServiceProvider instead to avoid
having to use assembly aliases. These were getting more complication
with the introduction of Visual Studio 2019 support.
The ServiceProgressData type is in a Visual Studio 2019 assembly that
we don't currently have access to. Using reflection to call the
CloneAsync in order to avoid conflicts with the Visual Studio 2017
version. Progress won't be displayed on the status bar, but it appears
prominently on the Team Explorer Home view.
Create a GitHub.TeamFoundation.16 project that will install and execute
inside Visual Studio 2019.
@jcansdale
Copy link
Collaborator Author

jcansdale commented Oct 26, 2018

Double clicking a repository on the connect list brings up the Getting started... dialog. It seems closing a solution caused the dialog to appear. This should be easy enough to fix.

Update: Fixed!

Stop the `How would you like to get started?` dialog from appearing
when a repository is double clicked on.

Convert GitHubConnectSection to use
ITeamExplorerServices.OpenRepository instead of
IVSServices.TryOpenRepository to change repository context. This method
knows how to change context for Visual Studio 2015, 2017 and 2019.
@jcansdale jcansdale changed the title [wip] Fix for Visual Studio 2019 Preview Fix for Visual Studio 2019 Preview Oct 26, 2018
BrowsesToTheCorrectURL was already being ignored but is now failing to
compile.
@codecov
Copy link

codecov bot commented Oct 26, 2018

Codecov Report

Merging #2014 into master will decrease coverage by 1.12%.
The diff coverage is 16.66%.

@@            Coverage Diff             @@
##           master    #2014      +/-   ##
==========================================
- Coverage   39.16%   38.03%   -1.13%     
==========================================
  Files         405      372      -33     
  Lines       17343    16099    -1244     
  Branches     2398     2216     -182     
==========================================
- Hits         6793     6124     -669     
+ Misses      10016     9538     -478     
+ Partials      534      437      -97
Impacted Files Coverage Δ
...GitHub.TeamFoundation.14/Services/VSGitServices.cs 0% <ø> (ø) ⬆️
....TeamFoundation.14/Connect/GitHubConnectSection.cs 0% <0%> (ø) ⬆️
...TeamFoundation.14/Connect/GitHubConnectSection1.cs 0% <0%> (ø) ⬆️
...TeamFoundation.14/Connect/GitHubConnectSection0.cs 0% <0%> (ø) ⬆️
src/GitHub.TeamFoundation.14/Services/VSGitExt.cs 90.16% <75%> (ø) ⬆️
...s.Reactive/Services/LocalRepositoriesExtensions.cs 0% <0%> (-100%) ⬇️
...rc/GitHub.App/Services/RepositoryPublishService.cs 0% <0%> (-78.27%) ⬇️
src/GitHub.Exports/Services/Connection.cs 0% <0%> (-76%) ⬇️
src/GitHub.Exports/SimpleJson.cs 0% <0%> (-47.22%) ⬇️
src/GitHub.Exports/Models/ConnectionDetails.cs 0% <0%> (-31.25%) ⬇️
... and 37 more

@meaghanlewis
Copy link
Contributor

This looks great to me! Tested in VS2015, 2017 and 2019

@meaghanlewis meaghanlewis merged commit adb4119 into master Oct 26, 2018
@meaghanlewis meaghanlewis deleted the fixes/2010-vs2019-preview branch October 26, 2018 17:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants